<?php

declare(strict_types=1);

namespace App\Request;

use Hyperf\Validation\Request\FormRequest;

class StoreQuestionRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     */
    public function authorize(): bool
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     */
    public function rules(): array
    {
        return [
            'title' => 'required|string',
            'type' => 'required|integer',
            'explain' => 'string',
            //'answers' => 'required'
        ];
    }

    public function attributes(): array
    {
        return [
            'title' => '试题题目',
            'type' => '试题类型',
            'explain' => '试题解析',
            //'answers' => '试题答案'
        ];
    }
}
